/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.testis.communication.data;

import org.testis.data.TestStepDataObject;


/**
 * A class used to hold communication module data
 * @author nurhat
 */
public class CommunicationModuleDataObject extends TestStepDataObject
{

    private static final long serialVersionUID = 19822L;
    private String m_host;
    private String m_userName;
    private String m_password;
    private int m_port;
    private String m_commandToSend;
    private String m_stringToSendAndVerify;
    private int m_keepAliveTime;
    private String m_commandPromptCharForTelnetClient;


    public CommunicationModuleDataObject()
    {
        m_keepAliveTime = 4000;
        setHost("");
        setUserName("");
        setPassword("");
        setCommandToSend("");
        setStringToSendAndVerify("");
        setCommandPromptCharForTelnetClient("#");

    }


    public CommunicationModuleDataObject(TestStepDataObject data)
    {

        super(data);
        m_keepAliveTime = 4000;
        setHost("");
        setUserName("");
        setPassword("");
        setCommandToSend("");
        setStringToSendAndVerify("");
        setCommandPromptCharForTelnetClient("#");

    }


    public String getHost()
    {
        return m_host;
    }


    public void setHost(String host)
    {
        this.m_host = host;
    }


    public String getUserName()
    {
        return m_userName;
    }


    public void setUserName(String userName)
    {
        this.m_userName = userName;
    }


    public String getPassword()
    {
        return m_password;
    }


    public void setPassword(String password)
    {
        this.m_password = password;
    }


    public int getPort()
    {
        return m_port;
    }


    public void setPort(int port)
    {
        this.m_port = port;
    }


    public String getCommandToSend()
    {
        return m_commandToSend;
    }


    public void setCommandToSend(String commandToSend)
    {
        this.m_commandToSend = commandToSend;
    }


    public String getStringToSendAndVerify()
    {
        return m_stringToSendAndVerify;
    }


    public void setStringToSendAndVerify(String stringToSendAndVerify)
    {
        this.m_stringToSendAndVerify = stringToSendAndVerify;
    }


    public int getKeepAliveTime()
    {
        return m_keepAliveTime;
    }


    public void setKeepAliveTime(int keepAliveTime)
    {
        this.m_keepAliveTime = keepAliveTime;
    }


    @Override
    public String toString()
    {
        StringBuilder sb = new StringBuilder();
        sb.append("\n");
        if (m_host != null && !m_host.equals("")) {
            sb.append("Host:" + m_host + "\n");
        }
        if (m_userName != null && !m_userName.equals("")) {
            sb.append("userName:" + m_userName + "\n");
        }
        if (m_password != null && !m_password.equals("")) {
            sb.append("password:" + m_password + "\n");
        }
        if (m_port != 0) {
            sb.append("port:" + m_port + "\n");
        }
        if (m_commandToSend != null && !m_commandToSend.equals("")) {
            sb.append("commandToSend:" + m_commandToSend + "\n");
        }
        if (m_stringToSendAndVerify != null && !m_stringToSendAndVerify.equals("")) {
            sb.append("stringToSendAndVerify:" + m_stringToSendAndVerify + "\n");
        }
        if (m_keepAliveTime != 0) {
            sb.append("keepAliveTime:" + m_keepAliveTime + "\n");
        }
        return sb.toString();
    }


    public String getCommandPromptCharForTelnetClient()
    {
        return m_commandPromptCharForTelnetClient;
    }


    public void setCommandPromptCharForTelnetClient(
        String commandPromptCharForTelnetClient)
    {
        this.m_commandPromptCharForTelnetClient = commandPromptCharForTelnetClient;
    }
}
